package com.zyc.fuckfx;

import com.zyc.fuckfx.base.ImageUtils;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.layout.BackgroundFill;
import javafx.scene.layout.CornerRadii;
import javafx.scene.paint.Color;
import javafx.scene.paint.Paint;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import org.kordamp.bootstrapfx.BootstrapFX;

import java.io.IOException;
/**
 * @Author AlbertZyc
 * @Date 2022/8/13
 * @description 自己悟出来
 */
public class FuckApplication extends Application {
    @Override
    public void start(Stage stage) throws IOException {
        FXMLLoader fxmlLoader = new FXMLLoader(FuckApplication.class.getResource("main-view.fxml"));
        Scene scene = new Scene(fxmlLoader.load(), 840, 600,Color.valueOf("#FAF9FF"));
        //修复Mac上的乱码问题
        scene.getRoot().setStyle("-fx-font-family: 'serif'");
        scene.getStylesheets().add(BootstrapFX.bootstrapFXStylesheet());
        scene.setFill(Color.valueOf("#FAF9FF"));
        scene.getStylesheets().add(FuckApplication.class.getResource("main-view-css.css").toExternalForm());
        stage.setTitle("Z-Util");
        stage.getIcons().add(ImageUtils.getResImage("icon_launcher.png"));
        stage.setScene(scene);
        stage.show();
    }

    public static void main(String[] args) {
        launch();
    }
}